<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*,java.util.*;" errorPage=""%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
 <jsp:useBean id="modify" scope="session" class="dataconn.MyDbBean"/>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>修改记录</title>
   </head>
   <body bgcolor="#FFFFFF" text="#000000">
       <div align="center"><font color="#000000" size="5">修改记录</font> </div>
       <%!	String xuehao,url,sql,sex; %>      
       <%
         xuehao=request.getParameter("xuehao").trim();
         //调用getConn()方法与数据库建立连接
         modify.getConn("Data_Stu","sa","");
         sql="select * from stuInfo where 学号='"+xuehao+"'";
         ResultSet  rs=modify.executeQuery1(sql);
         while(rs.next())
         {
         %>
               <form name="form1" method="post" action="change_query.jsp?xuehao=<%=xuehao%>">
                    <table width="35%" border="1" cellspacing="1" cellpadding="1" align="center">
                        <tr>
                            <td width="46%" align="center">学号 </td>
                            <td width="54%"> &nbsp;&nbsp;&nbsp;<%=rs.getString(1)%></td>
                         </tr>
                         <tr>
                             <td width="46%" align="center">姓名 </td>
                             <td width="54%"> &nbsp;&nbsp;&nbsp;
                                <input type="text" name="name" size="8" value=<%=rs.getString(2)%>></td>
                          </tr>
                          <tr>
                              <td width="46%" align="center">性别</td>
                              <td width="54%">&nbsp;&nbsp;
                              <%
                                 sex=rs.getString(3).trim();
                                 if(sex.equals("男"))
                                 {
                              %>
                              <select name="sex" size="1">
                                  <option value="男" selected>男</option>
                                  <option value="女">女</option>
                              </select>
                              <% }
                                 else{
                              %>
                              <select name="sex" size="1">
                                  <option value="男" >男</option>
                                  <option value="女"selected>女</option>
                              </select>
                              <% } %>
                             </td>
                         </tr>
                         <tr>
                             <td width="46%" align="center">年龄</td>
                             <td width="54%"> &nbsp;&nbsp;&nbsp;
                                <input type="text" name="age" size="2" value=<%=rs.getInt(4)%>></td>
                         </tr>
                         <tr>
                             <td width="46%" align="center">籍贯</td>
                             <td width="54%">&nbsp;&nbsp;&nbsp;
                                <input type="text" name="jiguan" size="8" value=<%=rs.getString(5)%>></td>
                         </tr>
                         <tr>
                             <td width="46%" align="center">院系</td>
                             <td width="54%"> &nbsp;&nbsp;&nbsp;
                             <input type="text" name="department" size="8" value=<%=rs.getString(6)%>></td>
                         </tr>
                         <tr align="center">
                             <td colspan="2" align="center">
                                 <input type="submit" name="Submit" value="提交">&nbsp;&nbsp;&nbsp;
                                 <input type="reset" name="reset" value="清空">
                             </td>
                        </tr>
                </table>
           </form>
           <%
             }
             rs.close();
            modify.closeStmt();
            modify.closeConn();
         %>
       </body>
</html>
